﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BusinessHanler;

namespace BusinessHandler
{
    public class NewsController : NewsDataClassesDataContext
    {
        private static NewsController instance;
        public static NewsController Instance
        {
            get
            {
                if (instance == null)
                    instance = new NewsController();
                return instance;
            }
            set
            {
                instance = value;
            }
        }
        public New GetNewsById(int newsID)
        {
            NewsDataClassesDataContext tmp = new NewsDataClassesDataContext();
            New item = (from o in tmp.News
                        where o.NewsID == newsID
                        select o).SingleOrDefault();
            return item;
        }
    }
}